function y = sc2(x)
% staircase 2 function
% x0=[0,0,...0];
n=length(x);
y=0; 
for i=1:n
    z=0;
    for j=1:i
        z=z+x(j);
    end
    y=y+(z-i)^2;
end


